﻿{% extends "forum/base.html" %}
{% load customfilters %}

{% block title %}
gaeBBS 论坛
{% endblock %}

{% block boardlinks %}
&#187; <a href="{{topic.forum.get_absolute_url}}">{{topic.forum.name}}</a>&#187; {{topic.subject}}
{% endblock %}

{% block content %}
<!--
<div id="pageheader">
    <h3><a class="titles" href="{{topic.get_absolute_url}}">{{topic.subject}}</a></h3>
</div>

<br clear="all" /><br />
-->
<div id="pagecontent">

    <table width="100%" cellspacing="1">
	<tr>
	    <td align="left" valign="middle" nowrap="nowrap">
		<a href="/forum/{{topic.forum.get_id}}/new_topic/"><img src="/site_media/styles/pandaxiaoxi/imageset/en/button_topic_new.gif" alt="Post new topic" title="Post new topic" /></a>&nbsp;<a href="/forum/topic/{{topic.get_id}}/new_post/"><img src="/site_media/styles/pandaxiaoxi/imageset/en/button_topic_reply.gif" alt="Reply to topic" title="Reply to topic" /></a>		</td>
	    <td class="nav" valign="middle" nowrap="nowrap">&nbsp;第 <strong>{{posts.number}}</strong> 页,共 <strong>{{posts.paginator.num_pages}}</strong> 页<br /></td>
 	    <td class="gensmall" nowrap="nowrap">&nbsp;[ {{posts.paginator.count}}篇文章 ]&nbsp;</td>
	    <td class="gensmall" width="100%" align="right" nowrap="nowrap">
                <b>
                {% if posts.has_previous %}
                    <a href="?page={{ posts.previous_page_number }}">上页</a>
                {% endif %}
                
                {% if posts.has_next %}
                    <a href="?page={{ posts.next_page_number }}">下页</a>
                {% endif %}
                <!--<a href="#" onclick="jumpto(); return false;" title="Click to jump to page…">Go to page</a> <strong>1</strong><span class="page-sep">, </span><a href="./viewtopic.php?f=1&amp;t=17499&amp;st=0&amp;sk=t&amp;sd=a&amp;start=15">2</a><span class="page-sep">, </span><a href="./viewtopic.php?f=1&amp;t=17499&amp;st=0&amp;sk=t&amp;sd=a&amp;start=30">3</a> &nbsp;<a href="./viewtopic.php?f=1&amp;t=17499&amp;st=0&amp;sk=t&amp;sd=a&amp;start=15">Next</a>-->
                </b>
            </td>
	</tr>
    </table>

    <table class="tablebg" width="100%" cellspacing="1">
	<tr>
	    <td class="cat">
		<table width="100%" cellspacing="0">
		    <tr>
			<td class="nav" nowrap="nowrap">&nbsp;
			    <a href="{{topic.get_absolute_url}}" title="{{topic.subject}}">主题：{{topic.subject}}</a>
                        </td>
			<td class="nav" align="right" nowrap="nowrap"><!--<a href="">上一主题</a> | <a href="">下一主题</a>&nbsp;--></td>
		    </tr>
		</table>
	    </td>
	</tr>
    </table>

    <table class="tablebg" width="100%" cellspacing="1">
	<tr>
	    <th>作者</th>
	    <th>正文</th>
	</tr>
        {% for post in posts %}
	{% if forloop.counter|is_odd %}
	<tr class="row1">
	{% else %}
	<tr class="row2">
	{% endif %}
	    <td align="center" valign="middle">
		<a name="p{{post.get_id}}"></a>
		<b class="postauthor">{{ post.author.username }}</b>
	    </td>
	    <td width="100%" height="25">
		<table width="100%" cellspacing="0">
		    <tr>
			<td class="gensmall" width="100%"><div style="float: left;"><b>发表于:</b> {{post.datetime1|date:"Y-m-d H:i"}}&nbsp;<!--&nbsp;<b>Post subject:</b> VESA problem, help--></div><div style="float: right;"><strong>{{post.num}}楼</strong></div></td>
                    </tr>
		</table>
	    </td>
	</tr>
		
	{% if forloop.counter|is_odd %}
	<tr class="row1">
	{% else %}
	<tr class="row2">
	{% endif %}
	    <td valign="top" class="profile">
                
		<table cellspacing="4" align="center" width="150">
		    <!--
                    <tr>
			<td><img src="./images/ranks/2.gif" alt="Member" title="Member" /></td>
		    </tr>
		    <tr>
			<td><img src="" width="80" height="80" alt="User avatar" /></td>
		    </tr>
                    -->
		</table>
        
		<span class="postdetails">
		    <br />性别: {{post.author|profile:"sex"}}
                    <br />文章: {{post.author|profile:"posts"}}
                    <br />来自: {{post.author|profile:"city"}}
                    <br />注册: {{ post.author.date_joined|date:"Y-m-d H:i" }}
                    <br /><img src="/site_media/styles/pandaxiaoxi/imageset/en/icon_user_offline.gif" alt="Offline" title="Offline" />
		</span>

	    </td>
	    <td valign="top">
		<table width="100%" cellspacing="5">
		    <tr>
			<td>
			    <div class="postbody">{{ post.content }}</div>
			    <br clear="all" /><br />
			    <table width="100%" cellspacing="0">
				<tr valign="middle">
				    <td class="gensmall" align="right"></td>
				</tr>
			    </table>
			</td>
		    </tr>
		</table>
	    </td>
	</tr>

	{% if forloop.counter|is_odd %}
	<tr class="row1">
	{% else %}
	<tr class="row2">
	{% endif %}
	    <td class="profile"><strong><a href="#wrapheader">Top</a></strong></td>
	    <td>
                <div class="gensmall" style="float: left;">&nbsp;<a href="/forum/member/{{post.author.get_id}}/"><img src="/site_media/styles/pandaxiaoxi/imageset/en/icon_user_profile.gif" alt="Profile" title="Profile" /></a> &nbsp;</div>
                <div class="gensmall" style="float: right;">{% ifequal userprofile post.author %}&nbsp;<a href="/forum/post/{{post.get_id}}/edit/"><img src="/site_media/styles/pandaxiaoxi/imageset/en/icon_post_edit.gif" alt="Profile" title="Profile" /></a> {% endifequal %}&nbsp;</div>
            </td>
	</tr>
	<tr>
	    <td class="spacer" colspan="2" height="2"><img src="images/spacer.gif" alt="" width="1" height="2" /></td>
	</tr>
    
        {% endfor %}
    </table>
<!--
<table width="100%" cellspacing="1" class="tablebg">
    <tr align="center">
	<td class="cat"><form name="viewtopic" method="post" action="./viewtopic.php?f=1&amp;t=17499&amp;start=0"><span class="gensmall">Display posts from previous:</span> <select name="st" id="st"><option value="0" selected="selected">All posts</option><option value="1">1 day</option><option value="7">7 days</option><option value="14">2 weeks</option><option value="30">1 month</option><option value="90">3 months</option><option value="180">6 months</option><option value="365">1 year</option></select>&nbsp;<span class="gensmall">Sort by</span> <select name="sk" id="sk"><option value="a">Author</option><option value="t" selected="selected">Post time</option><option value="s">Subject</option></select> <select name="sd" id="sd"><option value="a" selected="selected">Ascending</option><option value="d">Descending</option></select>&nbsp;<input class="btnlite" type="submit" value="Go" name="sort" /></form></td>
    </tr>
</table>
-->
    <table width="100%" cellspacing="1">
	<tr>
	    <td align="left" valign="middle" nowrap="nowrap">
		<a href="/forum/{{topic.forum.get_id}}/new_topic/"><img src="/site_media/styles/pandaxiaoxi/imageset/en/button_topic_new.gif" alt="Post new topic" title="Post new topic" /></a>&nbsp;<a href="/forum/topic/{{topic.get_id}}/new_post/"><img src="/site_media/styles/pandaxiaoxi/imageset/en/button_topic_reply.gif" alt="Reply to topic" title="Reply to topic" /></a>		</td>
	    <td class="nav" valign="middle" nowrap="nowrap">&nbsp;第 <strong>{{posts.number}}</strong> 页,共 <strong>{{posts.paginator.num_pages}}</strong> 页<br /></td>
 	    <td class="gensmall" nowrap="nowrap">&nbsp;[ {{posts.paginator.count}}篇文章 ]&nbsp;</td>
	    <td class="gensmall" width="100%" align="right" nowrap="nowrap">
                <b>
                {% if posts.has_previous %}
                    <a href="?page={{ posts.previous_page_number }}">上页</a>
                {% endif %}
                
                {% if posts.has_next %}
                    <a href="?page={{ posts.next_page_number }}">下页</a>
                {% endif %}
                <!--<a href="#" onclick="jumpto(); return false;" title="Click to jump to page…">Go to page</a> <strong>1</strong><span class="page-sep">, </span><a href="./viewtopic.php?f=1&amp;t=17499&amp;st=0&amp;sk=t&amp;sd=a&amp;start=15">2</a><span class="page-sep">, </span><a href="./viewtopic.php?f=1&amp;t=17499&amp;st=0&amp;sk=t&amp;sd=a&amp;start=30">3</a> &nbsp;<a href="./viewtopic.php?f=1&amp;t=17499&amp;st=0&amp;sk=t&amp;sd=a&amp;start=15">Next</a>-->
                </b>
            </td>
	</tr>
    </table>

</div>

<div id="pagefooter"></div>

<br clear="all" />

<table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;">
    <tr>
	<td class="row1">
	    <p class="breadcrumbs"><a href="/forum/">论坛首页</a>&#187; <a href="{{topic.forum.get_absolute_url}}">{{topic.forum.name}}</a>&#187; {{topic.subject}}</p>
	    
	</td>
    </tr>
</table>
<br clear="all" />


<table width="100%" cellspacing="0">
    <tr>
	<td><form method="post" name="search" action="#"><span class="gensmall">搜索:</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="搜" /></form></td>
	<td align="right">
            <table cellspacing="0" cellpadding="0" border="0">
	        <tr>
		    <td nowrap="nowrap"><span class="gensmall">跳转到:</span>&nbsp;
                        <select name="f" onchange="window.location='/forum/'+this.value+'/topics/'">
			    {% for f in all_forums %}
                            <option value="{{f.id}}">{{f.name}}</option>
                            {% endfor %}
		        </select>
                    </td>
	        </tr>
	    </table>
        </td>
    </tr>
</table>


{% endblock %}